﻿app.controller('NameController', function ($scope, MessageService) {
    MessageService.getMessages().then(function (data) {
        //deferred.resolve();
        alert('worked');
        $scope.chatArray = data;
    }, function () {
        alert('did not work');
        //deferred.reject();
    });
});